Estimate transmission wrapper#365
Conversation
| transmission_limits = (get_beamline_param( | ||
| beamline_config, ("gda.mx.udc.minTransmission",), 0.0), | ||
| min( | ||
| get_beamline_param( | ||
| beamline_config, ("gda.mx.udc.maxTransmission",), 1.0 | ||
| ), | ||
| recommended_max_transmission | ||
| ), | ||
| ) |
There was a problem hiding this comment.
Discussed on slack that rather than using the recommended_max transmission to set the transmission limits, the recommended transmission should be used in place of recipe_step.transmission (i.e. instead of the transmission value from the Agamemnon recipe). This means that the recommended transmission will be scaled appropriately for wavelength and resolution.
There was a problem hiding this comment.
I have tested with Phasing which has a recommended transmission of .25, and the recommended transmission from our wrapper is .44 and after scaling it returns to use .36 transmission in the dc. You can see it at https://ispyb-test.diamond.ac.uk/dc/visit/mx23694-156/id/21149301 for Phasing wedge 1
| for command, script, output_file in commands: | ||
| result = subprocess.run(script, cwd=working_directory, check=True) | ||
|
|
||
| while not os.path.exists(output_file): |
There was a problem hiding this comment.
Is this step necessary? Have you found that the dials.import subprocess returns without the output files existing?
|
|
||
| reflection_file = results_directory / "strong.refl" | ||
| reflections = flex.reflection_table.from_file(reflection_file) | ||
| num_counts, _ = self.build_hist_from_reflections(reflections) |
There was a problem hiding this comment.
As you've gone to the trouble of constructing a histogram, it would be good to plot this and have it as an output file. Additionally, you could output the histogram similarly to how xia2.overload does, so that the data is available as a result file. If this takes a some time to process, you could always run this after the wrapper sends the scaled_transmission off to the next recipe step, so that the pipeline is not slowed down.
There was a problem hiding this comment.
The histogram can just be saved using json.dump(...) and does not take much time. Would there be another why using JSONLines is preferable?
There was a problem hiding this comment.
No reason to use JSONLines, you can just create it in the wrapper as you have done
| return False | ||
|
|
||
| results_directory.mkdir(parents=True, exist_ok=True) | ||
| output_files = ["dials.find_spots.log", "strong.refl", "imported.expt"] |
There was a problem hiding this comment.
The strong.refl and imported.expt are probably not too useful to have as results files so I would omit them from here. I think it would be useful to construct a log file for this wrapper, that gives a simple overview of the running of the dials commands as well as the analysis of the spots afterwards.
Wrapper to estimate the max recommended transmission from dials.find_spots.